package com.practice.product.service.Impl;
import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

import com.practice.order.product.Product;
import com.practice.product.service.ProductService;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getByProductId(Long productId) {
        Product product = new Product();
        product.setId(productId);
        product.setPrice(new BigDecimal("99"));
        product.setProductName("苹果"+productId);
        product.setNum(2);

        //商品业务休眠100秒
/*        try {
            TimeUnit.SECONDS.sleep(2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/


        return product;
    }
}
